package com.sino.androiddesign.database.greenDataBase

import com.sino.androiddesign.database.greendao.DaoMaster
import com.sino.androiddesign.database.greendao.UserDao
import com.sino.androiddesign.main.DesignApp


class GreenUtils {

    companion object {
        val userDao = GreenUtils.setUpDataBase()

        private fun setUpDataBase(): UserDao? {
            val helper = DaoMaster.DevOpenHelper(DesignApp.appContext, "green.db", null)
            val database = helper.writableDatabase
            val daoMaster = DaoMaster(database)

            return daoMaster.newSession()!!.userDao
        }

    }

}
